using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.U2D.Animation;

public class Lesson40 : MonoBehaviour
{
    public SpriteResolver sr;

    private Dictionary<string, SpriteResolver> Dic;
    // Start is called before the first frame update
    void Start()
    {
        //sr.SetCategoryAndLabel(sr.GetCategory(), "asd");
        SpriteResolver[] srs= this.GetComponentsInChildren<SpriteResolver>();
        for (int i = 0; i < srs.Length; i++)
        {
            Dic.Add(srs[i].GetCategory(), srs[i]);
        }

        ChangeEquip("Cask", "CASK 1");
    }
    void ChangeEquip(string Category, string LabelName)
    {
        if (Dic.ContainsKey(Category))
        {
            Dic[Category].SetCategoryAndLabel(Category, LabelName);
        }
    }
    // Update is called once per frame
    void Update()
    {
        
    }
}
